Drupal.behaviors.mypage = function(){
var aj_url = Drupal.settings.basePath+'mysubscriptions/page';



	$('select#products').change(function(){
        $.ajax({
          type: "GET",
          url: aj_url,
          data: "category=" + this.value,
          success: function(result){
             $("#whole_content").html(result);
           }
        });
	});

$('table#group_messages_values td.content-multigroup-cell-field-multi-message div.form-item').each(function(){
	var id= $(this).attr('id');
		var text_area_id = $(this).attr('id');
		$("div#"+id+" textarea").bind('keyup', function() {
		  var cnt = $(this).val().length;
	      $("div#"+id+" div.grippie").html('Character count:'+cnt);	  	  
    });
		$("div#"+id+" textarea").bind('focus', function() {
		  var cnt = $(this).val().length;
	      $("div#"+id+" div.grippie").html('Character count:'+cnt);	  	  
    });

	$("div#"+id+" textarea").bind('blur', function() {
		  var cnt = $(this).val().length;
	      $("div#"+id+" div.grippie").html('Character count:'+cnt);	  	  
    });
});
//auto fill objective field by selecting objective samples field
	$('td.obj-samples input[type="radio"]').each(function(){
		  $(this).click(function(){if($(this).val() == 4){
				$('#edit-field-objective-0-value').text("");
				$('#edit-field-objective-0-value').focus();}
				else{$('#edit-field-objective-0-value').text($.trim($(this).parent().text()));}
			})
		});
//skills add another button text change
if($('input#edit-field-skills-value-Others:checked')){
$('#edit-field-skill-others-field-skill-others-add-more').val("+ Add a Skill")
}
$('#edit-field-skill-others-field-skill-others-add-more').val("+ Add a Skill");

//lang add another button text change
if($('input#edit-field-languages-value-Others:checked')){
$('#editedit-field-lang-others-field-lang-others-add-more').val("+ Add a Language")
}
$('#edit-field-lang-others-field-lang-others-add-more').val("+ Add a Language");
//for data fields add from text
$('.edit_time_period p').replaceWith('<span>From: </span>');

}


